package org.xiaojl.modules.sys.entity;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import org.xiaojl.utils.ToolUtil;
import com.baomidou.mybatisplus.annotations.TableName;
import org.xiaojl.common.base.BaseEntity;

/**
 * <p>
 * 组织机构
 * </p>
 *
 * @author xiaojl
 * @since 2017-09-19
 */
@TableName("sys_organization")
public class Organization extends BaseEntity<Organization> {

    private static final long serialVersionUID = 1L;

    /**
     * 组织名
     */
	private String name;
	
    /**
     * 地址
     */
	private String address;
	
    /**
     * 编号
     */
	private String code;
	
    /**
     * 图标
     */
	private String icon;
	
    /**
     * 父级主键
     */
	private Long pid;
	
    /**
     * 排序
     */
	private Integer seq;
	


	@Override
	public Wrapper<Organization> bindingQueryWrapper() {
		Wrapper<Organization> wrapper = new EntityWrapper<Organization>();
		if(ToolUtil.isNotEmpty(this.name)){
			wrapper.like("name", this.name);
		}
		if(ToolUtil.isNotEmpty(this.address)){
			wrapper.like("address", this.address);
		}
		if(ToolUtil.isNotEmpty(this.code)){
			wrapper.like("code", this.code);
		}
		if(ToolUtil.isNotEmpty(this.icon)){
			wrapper.like("icon", this.icon);
		}
		if(ToolUtil.isNotEmpty(this.seq)){
			wrapper.eq("seq", this.seq);
		}
		if(ToolUtil.isNotEmpty(this.createTimeStart)){
			wrapper.gt("createTime", this.createTimeStart);
		}
		if(ToolUtil.isNotEmpty(this.createTimeEnd)){
			wrapper.lt("createTime", this.createTimeEnd);
		}
		return wrapper;
	}


	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public Long getPid() {
		return pid;
	}

	public void setPid(Long pid) {
		this.pid = pid;
	}

	public Integer getSeq() {
		return seq;
	}

	public void setSeq(Integer seq) {
		this.seq = seq;
	}


	@Override
	public String toString() {
		return "Organization [ id=" + id 
				+ " name=" + name + ","
				+ " address=" + address + ","
				+ " code=" + code + ","
				+ " icon=" + icon + ","
				+ " pid=" + pid + ","
				+ " seq=" + seq + ","
				+ " createBy=" + createBy + ", createTime=" + createTime
				+ ", delFlag=" + delFlag + ", createTimeStart="
				+ createTimeStart + ", createTimeEnd=" + createTimeEnd + "]";
	}

}
